package com.hmall.feignclient;

import com.hmall.common.dto.Address;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author 苏成博
 * @date 2023-03-19 22:08
 */
@FeignClient("userservice")
@RequestMapping("address")
public interface AddressFeignClient {
    @GetMapping("/{id}")
    Address findAddressById(@PathVariable("id") Long id);

    @GetMapping("/uid/{userId}")
    List<Address> findAddressByUserId(@PathVariable("userId") Long userId);
}
